package com.csnf.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@NoArgsConstructor
@AllArgsConstructor
@Data
public class Result {
    private Integer code;
    private String msg;
    private Object data;

    //成功的方法
    public static Result success(Object data) {
    	return new Result(200, "操作成功", data);
    }

    //失败的方法
    public static Result error(Integer code, String msg, Object data) {
    	return new Result(code, msg, data);
    }
}
